<?php

namespace app\admin\model;

use think\Db;
use think\Model;


class Wechartmp extends Model
{

    

    

    // 表名
    protected $name = 'wechartmp';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'agency_text'
    ];
    
    public function getAgencyTextAttr($value, $data){
        $a = Db::table('fa_agency')->where('id',$data['agency_id'])->find();
        return $a?$a['name']:'';
    }
    







}
